import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: '/system/systemUser/login',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    data,
    headers: {
      'urlType':'admin'
    }
  })
}

export function createOrUpdate(params) {
  return request({
    url: '/system/systemUser/createOrUpdate',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    dataType: 'json',
    data: params,
    headers: {
      'urlType':'admin'
    }
  })
}

export function getByIdMoreDetail(dataId) {
  return request({
    url: '/system/systemUser/getByIdMoreDetail/' + dataId,
    method: 'get',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}

// 分页查询实体集合
export function queryForList(params) {
  return request({
    url: '/system/systemUser/queryForList',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    dataType: 'json',
    data: params,
    headers: {
      'urlType':'admin'
    }
  })
}

//判断是否登录
export function judgeLogin() {
  return request({
    url: '/system/systemUser/judgeLogin',
    method: 'get',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}

// 获取用户基本信息
export function getInfo(token) {
  return request({
    url: '/system/systemUser/getById/' + token,
    method: 'get',
    headers: {
      'urlType':'admin'
    }
  })
}

// 退出
export function logout() {
  return request({
    url: '/system/systemUser/logout',
    method: 'post',
    headers: {
      'urlType':'admin'
    }
  })
}

export function deleteData(dataId) {
  return request({
    url: '/system/systemUser/delete/' + dataId,
    method: 'post',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}